/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainView.java
 *
 * Created on 20/02/2012, 10:02:00 PM
 */
package view;

import entity.Empleado;
import util.Memoria;

/**
 *
 * @author Administrador
 */
public class MainView extends javax.swing.JFrame {

	/** Creates new form MainView */
	public MainView() {
		initComponents();
		Empleado obj = (Empleado) Memoria.get("empleado");
		this.setTitle("EUREKA [ Usuario: " + obj.getUsuario() + " - Codigo " + obj.getCodigo() +" ]");
		// Agregar Internals Frame
		desktopPane.add(ConEmpleadosView.getInstancia());
                desktopPane.add(RegistroDeposito.getInstancia());
                desktopPane.add(ConsultarCuenta.getInstancia());
                desktopPane.add(regCliente.getInstancia());
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        desktopPane = new javax.swing.JDesktopPane();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        openMenuItem = new javax.swing.JMenuItem();
        saveMenuItem = new javax.swing.JMenuItem();
        saveAsMenuItem = new javax.swing.JMenuItem();
        exitMenuItem = new javax.swing.JMenuItem();
        editMenu = new javax.swing.JMenu();
        cutMenuItem = new javax.swing.JMenuItem();
        copyMenuItem = new javax.swing.JMenuItem();
        pasteMenuItem = new javax.swing.JMenuItem();
        deleteMenuItem = new javax.swing.JMenuItem();
        helpMenu = new javax.swing.JMenu();
        contentMenuItem = new javax.swing.JMenuItem();
        aboutMenuItem = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        mnuRegistrarCliente = new javax.swing.JMenuItem();
        mnuConsultas = new javax.swing.JMenu();
        mnuConsultaEmpleados = new javax.swing.JMenuItem();
        mnuConsultarCuentaCliente = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        mnuRegistroDeposito = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        fileMenu.setMnemonic('f');
        fileMenu.setText("File");

        openMenuItem.setMnemonic('o');
        openMenuItem.setText("Open");
        fileMenu.add(openMenuItem);

        saveMenuItem.setMnemonic('s');
        saveMenuItem.setText("Save");
        fileMenu.add(saveMenuItem);

        saveAsMenuItem.setMnemonic('a');
        saveAsMenuItem.setText("Save As ...");
        saveAsMenuItem.setDisplayedMnemonicIndex(5);
        fileMenu.add(saveAsMenuItem);

        exitMenuItem.setMnemonic('x');
        exitMenuItem.setText("Exit");
        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        editMenu.setMnemonic('e');
        editMenu.setText("Edit");

        cutMenuItem.setMnemonic('t');
        cutMenuItem.setText("Cut");
        editMenu.add(cutMenuItem);

        copyMenuItem.setMnemonic('y');
        copyMenuItem.setText("Copy");
        editMenu.add(copyMenuItem);

        pasteMenuItem.setMnemonic('p');
        pasteMenuItem.setText("Paste");
        editMenu.add(pasteMenuItem);

        deleteMenuItem.setMnemonic('d');
        deleteMenuItem.setText("Delete");
        editMenu.add(deleteMenuItem);

        menuBar.add(editMenu);

        helpMenu.setMnemonic('h');
        helpMenu.setText("Help");

        contentMenuItem.setMnemonic('c');
        contentMenuItem.setText("Contents");
        helpMenu.add(contentMenuItem);

        aboutMenuItem.setMnemonic('a');
        aboutMenuItem.setText("About");
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        jMenu2.setText("Registro");

        mnuRegistrarCliente.setText("Cliente");
        mnuRegistrarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuRegistrarClienteActionPerformed(evt);
            }
        });
        jMenu2.add(mnuRegistrarCliente);

        menuBar.add(jMenu2);

        mnuConsultas.setText("Consultas");

        mnuConsultaEmpleados.setText("Empleados");
        mnuConsultaEmpleados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuConsultaEmpleadosActionPerformed(evt);
            }
        });
        mnuConsultas.add(mnuConsultaEmpleados);

        mnuConsultarCuentaCliente.setText("Cuenta el Cliente");
        mnuConsultarCuentaCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuConsultarCuentaClienteActionPerformed(evt);
            }
        });
        mnuConsultas.add(mnuConsultarCuentaCliente);

        menuBar.add(mnuConsultas);

        jMenu1.setText("Movimiento");

        mnuRegistroDeposito.setText("Registro de Deposito");
        mnuRegistroDeposito.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuRegistroDepositoActionPerformed(evt);
            }
        });
        jMenu1.add(mnuRegistroDeposito);

        menuBar.add(jMenu1);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 700, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 411, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
		 System.exit(0);
    }//GEN-LAST:event_exitMenuItemActionPerformed

	 private void mnuConsultaEmpleadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuConsultaEmpleadosActionPerformed
		 ConEmpleadosView.getInstancia().setVisible(true);
	 }//GEN-LAST:event_mnuConsultaEmpleadosActionPerformed

private void mnuRegistroDepositoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuRegistroDepositoActionPerformed

    RegistroDeposito.getInstancia().setVisible(true);
}//GEN-LAST:event_mnuRegistroDepositoActionPerformed

private void mnuConsultarCuentaClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuConsultarCuentaClienteActionPerformed
    ConsultarCuenta.getInstancia().setVisible(true);
}//GEN-LAST:event_mnuConsultarCuentaClienteActionPerformed

private void mnuRegistrarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuRegistrarClienteActionPerformed
    regCliente.getInstancia().setVisible(true);
}//GEN-LAST:event_mnuRegistrarClienteActionPerformed

	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {

			public void run() {
				new MainView().setVisible(true);
			}
		});
	}
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.JMenuItem contentMenuItem;
    private javax.swing.JMenuItem copyMenuItem;
    private javax.swing.JMenuItem cutMenuItem;
    private javax.swing.JMenuItem deleteMenuItem;
    private javax.swing.JDesktopPane desktopPane;
    private javax.swing.JMenu editMenu;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenuItem mnuConsultaEmpleados;
    private javax.swing.JMenuItem mnuConsultarCuentaCliente;
    private javax.swing.JMenu mnuConsultas;
    private javax.swing.JMenuItem mnuRegistrarCliente;
    private javax.swing.JMenuItem mnuRegistroDeposito;
    private javax.swing.JMenuItem openMenuItem;
    private javax.swing.JMenuItem pasteMenuItem;
    private javax.swing.JMenuItem saveAsMenuItem;
    private javax.swing.JMenuItem saveMenuItem;
    // End of variables declaration//GEN-END:variables
}
